cc.FileUtils:getInstance():addSearchPath("luaPlugin/src/")
cc.FileUtils:getInstance():addSearchPath("luaPlugin/res/")
-- CC_USE_DEPRECATED_API = true
require "cocos/init.lua"

-- cclog
cclog = function(...)
    print(string.format(...))
end

-- for CCLuaEngine traceback
function __G__TRACKBACK__(msg)
    cclog("----------------------------------------")
    cclog("LUA ERROR: " .. tostring(msg) .. "\n")
    cclog(debug.traceback())
    cclog("----------------------------------------")
end

local function main()
    -- avoid memory leak
    collectgarbage("setpause", 100)
    collectgarbage("setstepmul", 5000)

    require "hello2"
    cclog("result is " .. myadd(1, 1))

	local director = cc.Director:getInstance()
	if director then
		cclog("ok")
	else
		cclog("fail")
	end
end

xpcall(main, __G__TRACKBACK__)
